import request from '@/utils/request'

/**
 * 添加歌曲
 * @param data
 * @returns {*}
 */
export function addMusic(data) {
  return request({
    url: '/custom/music/addMusic',
    method: 'POST',
    headers: {
      isToken: true
    },
    data: data
  })
}

/**
 * 分页查询
 * @param params
 * @returns {*}
 */
export function findMusicPage(params) {
  return request({
    url: '/custom/music/finMusicPage',
    method: 'GET',
    headers: {
      isToken: true
    },
    params
  })
}

/**
 * 查询所有歌曲类型
 * @returns {*}
 */
export function findMusicTypeAll() {
  return request({
    url: '/custom/music-type/findMusicTypeAll',
    method: 'GET',
    headers: {
      isToken: true
    },
  })
}

/**
 * 批量添加歌曲
 * @returns {*}
 */
export function addMusicByList(data) {
  return request({
    url: '/custom/music/addMusicByList',
    method: 'POST',
    headers: {
      isToken: true
    },
    data: data
  })
}

/**
 * 根据ID修改
 */
export function updateMusicById(data){
  return request({
    url: '/custom/music/updateMusicById',
    method: 'PUT',
    headers: {
      isToken: true
    },
    data: data
  })
}

/**
 * 获取音乐资源
 * @param data
 * @returns {*}
 */
export function getMusicResource(params) {
  return request({
    url: '/custom/music/getMusicResource',
    method: 'GET',
    headers: {
      isToken: true
    },
    params
  })
}

/**
 * 获取音乐资源
 * @param data
 * @returns {*}
 */
export function delMusicById(params) {
  return request({
    url: '/custom/music/delMusicById',
    method: 'DELETE',
    headers: {
      isToken: true
    },
    params
  })
}

